import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

export default new Router({
	mode: "hash",
	linkActiveClass: "active",
	base: process.env.BASE_URL,
	routes: [{
			path: "/",
			redirect: "/index"
		},
		{
			path: "/index",
			name: "index",
			component: () =>
				import("./views/Index.vue"),
			children: [{
				path: "/index",
				redirect: "/index/home"
			}, {
				path: "/index/home",
				name: "home",
				meta: {
					index: 1,
					keepAlive: true
				},
				component: () =>
					import("./views/Home.vue")
			}, {
				path: "/index/find",
				name: "find",
				meta: {
					index: 2,
					keepAlive: true
				},
				component: () =>
					import("./views/Find.vue")
			}, {
				path: "/index/about",
				name: "about",
				meta: {
					index: 3,
					keepAlive: true
				},
				component: () =>
					import("./views/About.vue")
			}]
		}, {
			path: "/header",
			name: "header",
			meta: {
				index: 4,
				keepAlive: true
			},
			component: () =>
				import("./components/Header.vue"),
			children: [{
				path: "/header/register/:id",
				name: "register",
				meta: {
					index: 4,
					keepAlive: true
				},
				component: () =>
					import("./components/Register.vue")
			}, {
				path: "/header/main/:id",
				name: "main",
				meta: {
					index: 4,
					keepAlive: true
				},
				component: () =>
					import("./components/Main.vue")
			}, {
				path: "/header/music",
				name: "music",
				meta: {
					index: 4,
					keepAlive: true
				},
				component: () =>
					import("./components/Music.vue")
			}]
		}
	]
});